<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>友链编辑</title>
  <!--  公共头部-->
  <div th:replace="admin/common :: head"></div>
</head>
<body>

<!--公共导航-->
<div th:replace="admin/common :: menu(3)"></div>

  <div class="m-padded-tb-hugex">
  <div class="ui attached pointing menu">
    <div class="ui container">
      <div class="right menu">
        <a href="#" class="teal active item">编辑</a>
        <a href="#" th:href="@{/admin/friend}" class="item">列表</a>
      </div>
    </div>
  </div>
  </div>

  <!--中间内容-->
  <div  class="m-container-small m-padded-tb-massive">
    <div class="ui container">
      <form action="#" th:action="@{/admin/friend/modify(friendId=${friend.friendId})}" method="post" class="ui form">
        <div class=" field">

          <div class="ui left labeled input m-margin-top">
            <label class="ui teal basic label">博客名称</label>
            <input type="text" th:value="${friend.fname}" name="fname" placeholder="博客名称">
          </div>
          <div class="ui left labeled input m-margin-top">
            <label class="ui teal basic label">博客地址</label>
            <input type="text" th:value="${friend.address}" name="address" placeholder="博客地址">
          </div>
          <div class="ui left labeled input m-margin-top">
            <label class="ui teal basic label">图片地址</label>
            <input type="text" th:value="${friend.img}" name="Img" placeholder="图片地址">
          </div>
        </div>

        <div class="ui error message"></div>
        <div class="ui mini negative message">提示：友链不能为空</div>
        <div class="ui right aligned container">
          <button type="button" class="ui button" onclick="window.history.go(-1)" >返回</button>
          <button class="ui teal submit button">提交</button>
        </div>

      </form>
    </div>
  </div>

  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
<!--公共底部栏-->
<div th:replace="admin/common :: #footer"></div>

<!--公共js-->
<div th:replace="admin/common :: #js"></div>

  <script>
    $('.menu.toggle').click(function () {
      $('.m-item').toggleClass('m-mobile-hide');
    });

    $('.ui.dropdown').dropdown({
      on : 'hover'
    });

    $('.ui.form').form({
      fields : {
        fname : {
          identifier: 'fname',
          rules: [{
            type : 'empty',
            prompt: '请输入博客名称'
          }]
        },
        address : {
          identifier: 'address',
          rules: [{
            type : 'empty',
            prompt: '请输入博客地址'
          }]
        },
        Img : {
          identifier: 'Img',
          rules: [{
            type : 'empty',
            prompt: '请输入博客图片'
          }]
        }
      }
    });

  </script>
</body>
</html>